﻿using GalaSoft.MvvmLight;
using KPI.Entity.Entitys.VO;
using KPI.UIBase;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TYBase;

namespace KPIClient.Views
{
    public class ViewModelRecordDetail : ViewModelBase
    {
        private string _Name;
        public string Name { get => _Name; set => Set("Name", ref _Name, value); }

        private ObservableCollection<ExamUserInfo> _ListUserInfoInExam = new ObservableCollection<ExamUserInfo>();
        public ObservableCollection<ExamUserInfo> ListUserInfoInExam { get { return _ListUserInfoInExam; } set { Set("ListUserInfoInExam", ref _ListUserInfoInExam, value); } }


        private ExamUserInfo _SelectedUserInfoInExam;
        public ExamUserInfo SelectedUserInfoInExam { get => _SelectedUserInfoInExam; set => Set("SelectedUserInfoInExam", ref _SelectedUserInfoInExam, value); }

        private ObservableCollection<QuestionInfoModel> _ListQt = new ObservableCollection<QuestionInfoModel>();
        public ObservableCollection<QuestionInfoModel> ListQt { get { return _ListQt; } set { Set("ListQt", ref _ListQt, value); } }





    }

    public class ExamUserInfo : VMBase
    {
        private string _UserName;
        public string UserName { get => _UserName; set => Set("UserName", ref _UserName, value); }

        private string _OfficeName;
        public string OfficeName { get => _OfficeName; set => Set("OfficeName", ref _OfficeName, value); }

        private int _Score;
        public int Score { get => _Score; set => Set("Score", ref _Score, value); }

        private string _SubmitTime;
        public string SubmitTime { get => _SubmitTime; set => Set("SubmitTime", ref _SubmitTime, value); }
        public UserInExamInfo Data { get; private set; }

        internal void FromData(UserInExamInfo item)
        {
            this.Data = item;
            UserName = item.userName;
            OfficeName = item.officeName;
            SubmitTime = item.createTime.NullAsTimeStr();
            Score = item.score;

        }
    }
}
